
<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <title>登入 - xxx</title>
    <link rel="shortcut icon" type="image/ico" th:href="@{/static/favicon.ico}"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link th:href="@{/static/plugins/layui/css/layui.css}" rel="stylesheet">
    <link th:href="@{/static/css/admin.css}" rel="stylesheet">
    <link th:href="@{/static/css/login.css}" rel="stylesheet">
    <link th:href="@{/static/plugins/font-awesome-4.7.0/css/font-awesome.min.css}" rel="stylesheet">
</head>
<body>

<div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;">
    <div class="layadmin-user-login-main">
        <div class="layadmin-user-login-box layadmin-user-login-header">
            <h2>xxxx小程序</h2>
            <p><a href="javascript:void(0);" id="showMiniQrCode">请关xxx小程序</a></p>

        </div>
        <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
            <div class="layui-form-item">
                <label class="layadmin-user-login-icon fa fa-2x fa-mobile" ></label>
                <input type="text" value="" name="account"  lay-verify="required" placeholder="手机号码" class="layui-input">
            </div>
            <div class="layui-form-item">
                <label class="layadmin-user-login-icon fa fa-2x fa-keyboard-o" ></label>
                <input type="password" value="" aria-invalid="password"  name="password"  lay-verify="required" placeholder="密码" class="layui-input">
            </div>
            <div class="layui-form-item">
                <div class="layui-row">
                    <div class="layui-col-xs7">
                        <label class="layadmin-user-login-icon fa fa-2x fa-check" for="code"></label>
                        <input id="code" type="text" name="code"  lay-verify="required" placeholder="图形验证码" class="layui-input">
                    </div>
                    <div class="layui-col-xs5">
                        <div style="margin-left: 10px;">
                            <img th:src="@{/api/captcha/get}" class="layadmin-user-login-codeimg" id="LAY-user-get-vercode" style="height: 40px">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item" style="margin-bottom: 20px;">
                <input type="checkbox" name="remember" lay-skin="primary" title="记住密码">
                <a href="javascript:void(0);" class="layadmin-user-jump-change layadmin-link" style="margin-top: 7px;">忘记密码？</a>
            </div>
            <div class="layui-form-item">
                <button class="layui-btn layui-btn-fluid" id="loginSubmit" lay-submit lay-filter="loginSubmit" style="width: 100%">登 入</button>
            </div>
        </div>
    </div>


</div>
<script th:src="@{/static/plugins/layui/layui.js}"></script>

<script>
    layui.use(['form','layer'], function() {
        var pathName=window.document.location.pathname;
        pathName=pathName.substring(0,pathName.substr(1).indexOf('/')+1);
        var $ = layui.jquery,form = layui.form,layer= layui.layer;
        $("#LAY-user-get-vercode").click(function(){
            $(this).attr("src",pathName+"/api/captcha/get?t="+new Date().getTime());
        });


        $(document).keydown(function (e) {
            if (e.keyCode === 13) {
                $("#loginSubmit").trigger("click");
            }
        });
        //监听提交
        form.on('submit(loginSubmit)', function(data){
            window.location.href=pathName+'/index';
            return false;

        });
    })

</script>

</body>
</html>